import 'package:Sayagh/Configs.dart';
import 'package:Sayagh/Drawer.dart';
import 'package:Sayagh/i18n/i18nLocale.dart';
import 'package:Sayagh/tablepress/Cities.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

import 'Home.dart';

void main() {
  openDb().then((_) {
    if (kDebugMode) {
      updateDrawerGoodsDb()
//          .catchError((onError) => print(onError))
          .then((onValue) {
        updateDrawerCitiesDb().then((_) {
          runApp(MyApp());
        });
      });
    } else
      runApp(MyApp());
  });
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: i18nLocale[ourLocale]['asnafHormozgan'],
      theme: ThemeData(
        fontFamily: "Nahid",
        primarySwatch: Colors.blue,
      ),
      home: Home(),
      // MyHomePage(title: i18nLocale.fa['title']),
    );
  }
}
